class StudentPO:
    # 构造函数
    def __init__(self, stu_id=None, stu_name=None, course_name=None, com_grade=None, end_grade=None, total_grade=None,
                 grade_point=None):
        # 学号
        self.stu_id = stu_id
        self.stu_name = stu_name
        self.course_name = course_name
        self.com_grade = com_grade
        self.end_grade = end_grade
        self.total_grade = total_grade
        self.grade_point = grade_point

    # setter和getter方法
    def set_stu_id(self, stu_id):
        self.stu_id = stu_id

    def get_stu_id(self):
        return self.stu_id

    def set_stu_name(self, stu_name):
        self.stu_name = stu_name

    def get_stu_name(self):
        return self.stu_name

    def set_course_name(self, course_name):
        self.course_name = course_name

    def get_course_name(self):
        return self.course_name

    def set_com_grade(self, com_grade):
        self.com_grade = com_grade

    def get_com_grade(self):
        return self.com_grade

    def set_end_grade(self, end_grade):
        self.end_grade = end_grade

    def get_end_grade(self):
        return self.end_grade

    def set_total_grade(self, total_grade):
        self.total_grade = total_grade

    def get_total_grade(self):
        return self.total_grade

    def set_grade_point(self, grade_point):
        self.grade_point = grade_point

    def get_grade_point(self):
        return self.grade_point

    # 传入一个字典，将字典中的值设置到对象中
    def set_student_info(self, values:dict):
        self.set_stu_id(values['stu_id'])

        self.set_stu_name(values['stu_name'])

        self.set_course_name(values['course_name'])

        self.set_com_grade(values['com_grade'])

        self.set_end_grade(values['end_grade'])

        self.set_total_grade(values['total_grade'])

        self.set_grade_point(values['grade_point'])

    # 返回对象属性字典
    def get_student_info(self):
        return {
            'stu_id': self.get_stu_id(),
            'stu_name': self.get_stu_name(),
            'course_name': self.get_course_name(),
            'com_grade': self.get_com_grade(),
            'end_grade': self.get_end_grade(),
            'total_grade': self.get_total_grade(),
            'grade_point': self.get_grade_point()
        }
